package com.java.comprehensive.design.building_modelling.abstract_factory_pattern.cainiao;


import cn.hutool.core.util.StrUtil;

/**
 * @program: comprehensive-service
 * @description: 工厂实现类
 * @author: 窦绍飞
 * @create: 2021-11-24 15:15
 **/
public class ColorFactory extends AbstractFactory {
    public static String MSG = "This is Color";

    public static String RED = "red";
    public static String GREEN = "green";
    public static String BLUE = "blue";


    @Override
    public Shape getShape(String shapeType) {
        return null;
    }

    @Override
    public Color getColor(String colorType) {
        Color color = null;
        if (StrUtil.isBlank(colorType))
            return null;
        if (colorType.equals(ColorFactory.RED)) {
            color = new Red();
        } else if (colorType.equals(ColorFactory.GREEN)) {
            color = new Green();
        } else if (colorType.equals(ColorFactory.BLUE)) {
            color = new Blue();
        }
        return color;
    }
}
